import { BaseEntity } from '../../base/entity/base';
import { Column, Entity } from 'typeorm';

@Entity('content_article', { comment: '文章' })
export class ContentArticleEntity extends BaseEntity {
    @Column({ comment: '标题' })
    title: string;

    @Column({ comment: '封面', nullable: true })
    cover: string;

    @Column({ comment: '摘要', nullable: true, type: 'text' })
    digest: string;

    @Column({ comment: '内容', type: 'mediumtext', nullable: true })
    content: string;

    @Column({ comment: '状态 0-草稿 1-发布', default: 1, type: 'tinyint' })
    status: number;

    @Column({ comment: '浏览量', default: 0 })
    viewCount: number;

    @Column({ comment: '发布时间', nullable: true, type: 'datetime' })
    publishTime: Date;
}

